<div class="container index-container index-project">
	<h3 class="section-title"><span>活动</span></h3>
	<div data-am-widget="tabs" class="am-tabs am-tabs-default">
      	<ul class="am-tabs-nav am-cf">
          <li class="am-active"><a href="[data-tab-panel-0]">招募中</a></li>
          <li class=""><a href="[data-tab-panel-1]">进行中</a></li>
          <li class=""><a href="[data-tab-panel-2]">已结束</a></li>
      	</ul>
     	<div class="am-tabs-bd">
        	<div data-tab-panel-0 class="am-tab-panel am-active">
                <ul data-am-widget="gallery" class="am-gallery am-avg-sm-1 am-avg-md-2 am-avg-lg-3 am-gallery-bordered" data-am-gallery="{ pureview: false }" >
                	<notempty name="event_lists_do">
                		<volist name="event_lists_do" id="vo">
                			<li>
						       <div class="am-gallery-item">
								    <a href="{:U('Event/Index/detail',array('id'=>$vo['id']))}" class="">
								      <img src="{$vo.cover_id|getThumbImageById=354,208}"  alt="{$vo.title}"/>
								    </a>
								    <h3 class="am-gallery-title"><a href="{:U('Event/Index/detail',array('id'=>$vo['id']))}" class="">{$vo.title}</a></h3>
								    <div class="am-gallery-desc">
										<p><span>活动地点：</span>{$vo.address}</p>
										<p><span>发起组织：</span>{$vo.group.title}</p>
										<p><span>报名时间：</span>{:date('Y-m-d',$vo['deadline'])}截止</p>
										<p><span>报名人数：</span>{$vo.signCount}</p>
										<if condition="($vo['uid'] eq is_login()) OR is_administrator(is_login())">
								
						                    <if condition="time() lt $vo['eTime']">
						                        <a class="btn btn-default endEvent" data-eventID="{$vo.id}"><i class="fa am-icon-clock-o"></i>&nbsp;{:L('_OVER_AHEAD_')}</a>
						                    </if>
						
						                    <a href="{:U('Event/index/edit',array('id'=>$vo['id']))}" class="btn btn-default"><i class="fa am-icon-edit"></i>&nbsp;{:L('_EVENT_EDIT_')}</a>
						                    <a class="btn btn-default delEvent" data-eventID="{$vo.id}"><i class="fa am-icon-close"></i>&nbsp;{:L('_EVENT_DELETE_')}</a>
						                </if>
						                <if condition="($vo['uid'] neq is_login())">
						                    <php>if(!$vo['check_isSign']){</php>
						
						                    <php>if($vo['deadline'] < time()){</php>
						                    <p class="join"><a class="join grey" href="javascript:">报名<br/>已截止</a></p>
						                    <php>}else{</php>
						                    <if condition="is_login() eq 0">
						                        <p class="join-a"><a class="join" href="javascript:" style="color: #fff" onclick="toast.error({:L('_ERROR_REGISTER_AFTER_LOGIN_')})">立即<br/>报名</a></p>
						                        <else/>
						                        <if condition="check_auth('Event/Index/doSign')">
						                            <p class="join-a"><a class="join event_sign " style="color: #fff" href="{:U('Event/index/ajax_sign',array('event_id'=>$vo['id']))}">立即<br/>报名</a></p>
						                        </if>
						                    </if>
						                    <php>}</php>
						                    <php>}else{</php>
						                    <p class="join-a"><a class="join unSign " data-eventID="{$vo.id}" href="javascript:" id="unSign">取消<br/>报名</a>								
						                    <span class="msg" style="line-height: 34px;"> {:L('_REGISTER_ED_')}&nbsp;&nbsp;<if condition="$vo['check_isSign'][0]['status'] eq 1">{:L('_AUDIT_ED_')}
						                        <else/>
							                        {:L('_AUDIT_OP_')}
							                    </if></span>
							                    </p>
						                    <php>}</php>
						                </if>
								    </div>
								</div>
								<block name="script">
								    <script type="text/javascript" src="__STATIC__/uploadify/jquery.uploadify.min.js"></script>
								    <script>
								        $(function () {
								            $('#top_nav >li >a ').mouseenter(function () {
								                $('.children_nav').hide();
								                $('#children_' + $(this).attr('data')).show();
								            });
								
								
								            $('.event_sign').magnificPopup({
								                type: 'ajax',
								                overflowY: 'scroll',
								                modal: true,
								                callbacks: {
								                    ajaxContentAdded: function () {
								                        console.log(this.content);
								                    }
								                }
								            });
								
								            /**
								             * 取消报名
								             * */
								            $('#unSign').click(function () {
								                if (confirm("{:L('_PROMPT_CANCEL_')}{:L('_QUESTION_')}")) {
								                    var event_id = "{$content['id']}";
								                    $.post("{:U('Event/Index/unSign')}", {event_id: event_id}, function (res) {
								                        if (res.status) {
								                            toast.success(res.info);
								                            setTimeout(function () {
								                                location.reload();
								                            }, 1500);
								                        }
								                        else {
								                            toast.error(res.info);
								                        }
								                    }, 'json');
								                }
								            });
								            /**
								             * 删除活动事件
								             * */
								            $(".delEvent[data-eventID='{$vo.id}']").click(function () {
								                if (confirm("{:L('_PROMPT_DELETE_')}{:L('_QUESTION_')}")) {
								                    var event_id = "{$vo['id']}";
								                    $.post("{:U('Event/Index/doDelEvent')}", {event_id: event_id}, function (res) {
								                        if (res.status) {
								                            toast.success(res.info);
								                            setTimeout(function () {
								                                location.href = "{:U('index')}";
								                            }, 1500);
								                        }
								                        else {
								                            toast.error(res.info);
								                        }
								                    }, 'json');
								                }
								            });
								            /**
								             * 提前结束活动点击事件
								             */
								            $(".endEvent[data-eventID='{$vo.id}']").click(function () {
								                if (confirm("{:L('_PROMPT_OVER_')}{:L('_QUESTION_')}")) {
								                    var event_id = "{$vo['id']}";
								                    $.post("{:U('Event/Index/doEndEvent')}", {event_id: event_id}, function (res) {
								                        if (res.status) {
								                            toast.success(res.info);
								                            setTimeout(function () {
								                                location.reload();
								                            }, 1500);
								                        }
								                        else {
								                            toast.error(res.info);
								                        }
								                    }, 'json');
								                }
								            });
								        })
								    </script>
								
								</block>		
					        </li>
                		</volist>						      					      
			     	</notempty>
			  	</ul>
          	</div>
          	<div data-tab-panel-1 class="am-tab-panel ">
            	<ul data-am-widget="gallery" class="am-gallery am-avg-sm-1 am-avg-md-2 am-avg-lg-3 am-gallery-bordered" data-am-gallery="{ pureview: true }" >
			 		<notempty name="event_lists_doing">
                		<volist name="event_lists_doing" id="vo">
                			<li>								        								        <div class="am-gallery-item">
							    <a href="{:U('Event/Index/detail',array('id'=>$vo['id']))}" class="">
							      <img src="{$vo.cover_id|getThumbImageById=354,208}"  alt="{$vo.title}"/>
							    </a>
							    <h3 class="am-gallery-title"><a href="{:U('Event/Index/detail',array('id'=>$vo['id']))}" class="">{$vo.title}</a></h3>
							    <div class="am-gallery-desc">
									<p><span>活动地点：</span>{$vo.address}</p>
									<p><span>发起组织：</span>{$vo.group.title}</p>
									<p><span>报名时间：</span>{:date('Y-m-d',$vo['deadline'])}截止</p>
									<p><span>报名人数：</span>{$vo.signCount}</p>
									<if condition="($vo['uid'] eq is_login()) OR is_administrator(is_login())">
							
					                    <if condition="time() lt $vo['eTime']">
					                        <a class="btn btn-default endEvent" data-eventID="{$vo.id}"><i class="fa am-icon-clock-o"></i>&nbsp;{:L('_OVER_AHEAD_')}</a>
					                    </if>
					
					                    <a href="{:U('Event/index/edit',array('id'=>$vo['id']))}" class="btn btn-default"><i class="fa am-icon-edit"></i>&nbsp;{:L('_EVENT_EDIT_')}</a>
					                    <a class="btn btn-default delEvent" data-eventID="{$vo.id}"><i class="fa am-icon-close"></i>&nbsp;{:L('_EVENT_DELETE_')}</a>
					                </if>
					                <if condition="($vo['uid'] neq is_login())">
					                    <php>if(!$vo['check_isSign']){</php>
					
					                    <php>if($vo['deadline'] < time()){</php>
					                    <p class="join-a"><a class="join grey " href="javascript:" >报名<br/>已截止</a></p>
					                    <php>}else{</php>
					                    <if condition="is_login() eq 0">
					                        <a class="btn btn-info  " href="javascript:" style="color: #fff" onclick="toast.error({:L('_ERROR_REGISTER_AFTER_LOGIN_')})">{:L('_REGISTER_OP_')} </a>
					                        <else/>
					                        <if condition="check_auth('Event/Index/doSign')">
					                            <p class="join-a"><a class="join event_sign " style="color: #fff" href="{:U('Event/index/ajax_sign',array('event_id'=>$vo['id']))}">立即<br/>报名</a></p>
					                        </if>
					                    </if>
					                    <php>}</php>
					                    <php>}else{</php>
					                    <p class="join-a"><a class="join unSign " data-eventID="{$vo.id}" href="javascript:" id="unSign">取消<br/>报名</a>
					
					                    <span class="msg" style="line-height: 34px;"> {:L('_REGISTER_ED_')}&nbsp;&nbsp;<if condition="$vo['check_isSign'][0]['status'] eq 1">{:L('_AUDIT_ED_')}
					                        <else/>
						                        {:L('_AUDIT_OP_')}
						                    </if></span>
						                    </p>
					                    <php>}</php>
					                </if>
								    </div>
								</div>
																		<block name="script">
								    <script type="text/javascript" src="__STATIC__/uploadify/jquery.uploadify.min.js"></script>
								    <script>
								        $(function () {
								            $('#top_nav >li >a ').mouseenter(function () {
								                $('.children_nav').hide();
								                $('#children_' + $(this).attr('data')).show();
								            });
								
								
								            $('.event_sign').magnificPopup({
								                type: 'ajax',
								                overflowY: 'scroll',
								                modal: true,
								                callbacks: {
								                    ajaxContentAdded: function () {
								                        console.log(this.content);
								                    }
								                }
								            });
								
								
								
								            /**
								             * 取消报名
								             * */
								            $('#unSign').click(function () {
								                if (confirm("{:L('_PROMPT_CANCEL_')}{:L('_QUESTION_')}")) {
								                    var event_id = "{$content['id']}";
								                    $.post("{:U('Event/Index/unSign')}", {event_id: event_id}, function (res) {
								                        if (res.status) {
								                            toast.success(res.info);
								                            setTimeout(function () {
								                                location.reload();
								                            }, 1500);
								                        }
								                        else {
								                            toast.error(res.info);
								                        }
								                    }, 'json');
								                }
								            });
								            /**
								             * 删除活动事件
								             * */
								            $(".delEvent[data-eventID='{$vo.id}']").click(function () {
								            	alert({$vo.id});
								                if (confirm("{:L('_PROMPT_DELETE_')}{:L('_QUESTION_')}")) {
								                    var event_id = "{$vo['id']}";
								                    $.post("{:U('Event/Index/doDelEvent')}", {event_id: event_id}, function (res) {
								                        if (res.status) {
								                            toast.success(res.info);
								                            setTimeout(function () {
								                                location.href = "{:U('index')}";
								                            }, 1500);
								                        }
								                        else {
								                            toast.error(res.info);
								                        }
								                    }, 'json');
								                }
								            });
								            /**
								             * 提前结束活动点击事件
								             */
								            $(".endEvent[data-eventID='{$vo.id}']").click(function () {
								                if (confirm("{:L('_PROMPT_OVER_')}{:L('_QUESTION_')}")) {
								                    var event_id = "{$vo['id']}";
								                    $.post("{:U('Event/Index/doEndEvent')}", {event_id: event_id}, function (res) {
								                        if (res.status) {
								                            toast.success(res.info);
								                            setTimeout(function () {
								                                location.reload();
								                            }, 1500);
								                        }
								                        else {
								                            toast.error(res.info);
								                        }
								                    }, 'json');
								                }
								            });
								        })
								    </script>
								
								</block>
					      	</li>	
                		</volist>						      					      
			     	</notempty>
			 	</ul>
          	</div>
          	<div data-tab-panel-2 class="am-tab-panel ">
            	<ul data-am-widget="gallery" class="am-gallery am-avg-sm-1 am-avg-md-2 am-avg-lg-3 am-gallery-bordered" data-am-gallery="{ pureview: true }" >
            		<notempty name="event_lists_did">
                		<volist name="event_lists_did" id="vo">
                			<li>
						        								        <div class="am-gallery-item">
							    <a href="{:U('Event/Index/detail',array('id'=>$vo['id']))}" class="">
							      <img src="{$vo.cover_id|getThumbImageById=354,208}"  alt="{$vo.title}"/>
							    </a>
							    <h3 class="am-gallery-title"><a href="{:U('Event/Index/detail',array('id'=>$vo['id']))}" class="">{$vo.title}</a></h3>
							    <div class="am-gallery-desc">
									<p><span>活动地点：</span>{$vo.address}</p>
									<p><span>发起组织：</span>{$vo.group.title}</p>
									<p><span>报名时间：</span>{:date('Y-m-d',$vo['deadline'])}截止</p>
									<p><span>报名人数：</span>{$vo.signCount}</p>
									<if condition="($vo['uid'] eq is_login()) OR is_administrator(is_login())">
							
					                    <if condition="time() lt $vo['eTime']">
					                        <a class="btn btn-default endEvent" data-eventID="{$vo.id}"><i class="fa am-icon-clock-o"></i>&nbsp;{:L('_OVER_AHEAD_')}</a>
					                    </if>
					
					                    <a href="{:U('Event/index/edit',array('id'=>$vo['id']))}" class="btn btn-default"><i class="fa am-icon-edit"></i>&nbsp;{:L('_EVENT_EDIT_')}</a>
					                    <a class="btn btn-default delEvent" data-eventID="{$vo.id}"><i class="fa am-icon-close"></i>&nbsp;{:L('_EVENT_DELETE_')}</a>
					                </if>
					                <if condition="($vo['uid'] neq is_login())">
					                    <php>if(!$vo['check_isSign']){</php>
					
					                    <php>if($vo['deadline'] < time()){</php>
					                    <p class="join-a"><a class="join grey" href="javascript:">报名<br/>已截止</a></p>
					                    <php>}else{</php>
					                    <if condition="is_login() eq 0">
					                        <a class="btn btn-info  " href="javascript:" style="color: #fff" onclick="toast.error({:L('_ERROR_REGISTER_AFTER_LOGIN_')})">{:L('_REGISTER_OP_')} </a>
					                        <else/>
					                        <if condition="check_auth('Event/Index/doSign')">
					                            <p class="join-a"><a class="join event_sign " style="color: #fff" href="{:U('Event/index/ajax_sign',array('event_id'=>$vo['id']))}">立即<br/>报名</a></p>
					                        </if>
					                    </if>
					                    <php>}</php>
					                    <php>}else{</php>
					                    <p class="join-a"><a class="join unSign " data-eventID="{$vo.id}" href="javascript:" id="unSign">取消<br/>报名</a>
					
					                    <span class="msg" style="line-height: 34px;"> {:L('_REGISTER_ED_')}&nbsp;&nbsp;<if condition="$vo['check_isSign'][0]['status'] eq 1">{:L('_AUDIT_ED_')}
					                        <else/>
						                        {:L('_AUDIT_OP_')}
						                    </if></span>
						                    </p>
						                    <php>}</php>
						                </if>
								    </div>
								</div>
								<block name="script">
								    <script type="text/javascript" src="__STATIC__/uploadify/jquery.uploadify.min.js"></script>
								    <script>
								        $(function () {
								            $('#top_nav >li >a ').mouseenter(function () {
								                $('.children_nav').hide();
								                $('#children_' + $(this).attr('data')).show();
								            });
								
								
								            $('.event_sign').magnificPopup({
								                type: 'ajax',
								                overflowY: 'scroll',
								                modal: true,
								                callbacks: {
								                    ajaxContentAdded: function () {
								                        console.log(this.content);
								                    }
								                }
								            });
								
								
								
								            /**
								             * 取消报名
								             * */
								            $('#unSign').click(function () {
								                if (confirm("{:L('_PROMPT_CANCEL_')}{:L('_QUESTION_')}")) {
								                    var event_id = "{$content['id']}";
								                    $.post("{:U('Event/Index/unSign')}", {event_id: event_id}, function (res) {
								                        if (res.status) {
								                            toast.success(res.info);
								                            setTimeout(function () {
								                                location.reload();
								                            }, 1500);
								                        }
								                        else {
								                            toast.error(res.info);
								                        }
								                    }, 'json');
								                }
								            });
								            /**
								             * 删除活动事件
								             * */
								            $(".delEvent[data-eventID='{$vo.id}']").click(function () {
								            	alert({$vo.id});
								                if (confirm("{:L('_PROMPT_DELETE_')}{:L('_QUESTION_')}")) {
								                    var event_id = "{$vo['id']}";
								                    $.post("{:U('Event/Index/doDelEvent')}", {event_id: event_id}, function (res) {
								                        if (res.status) {
								                            toast.success(res.info);
								                            setTimeout(function () {
								                                location.href = "{:U('index')}";
								                            }, 1500);
								                        }
								                        else {
								                            toast.error(res.info);
								                        }
								                    }, 'json');
								                }
								            });
								            /**
								             * 提前结束活动点击事件
								             */
								            $(".endEvent[data-eventID='{$vo.id}']").click(function () {
								                if (confirm("{:L('_PROMPT_OVER_')}{:L('_QUESTION_')}")) {
								                    var event_id = "{$vo['id']}";
								                    $.post("{:U('Event/Index/doEndEvent')}", {event_id: event_id}, function (res) {
								                        if (res.status) {
								                            toast.success(res.info);
								                            setTimeout(function () {
								                                location.reload();
								                            }, 1500);
								                        }
								                        else {
								                            toast.error(res.info);
								                        }
								                    }, 'json');
								                }
								            });
								        })
								    </script>
								
								</block>
					      	</li>	
                		</volist>						      					      
			     	</notempty>
		  		</ul>
          	</div>
      	</div>
  	</div>
</div>
